﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SynoManager.FileStation
{
    public class VolumeInfo
    {
        private string name;
        private long free;
        private long used;

        internal VolumeInfo(FileStationClient.GetFSResult fsResult)
        {
            this.name = fsResult.currVolume.Trim(' ', '/');
            this.free = ByteSize.Parse(fsResult.free);
            this.used = ByteSize.Parse(fsResult.used);
        }
        public string Name
        {
            get { return name; }
        }

        public long SpaceFree
        {
            get
            {
                return free;
            }
        }

        public long SpaceUsed
        {
            get
            {
                return used;
            }
        }

        public override string ToString()
        {
            return name + " (Free: " + free.ToByteString() + ", Used: " + used.ToByteString() + ")";
        }
    }
}
